home *** CD-ROM | disk | FTP | other *** search
- /*
- ** ╔══════════════════════════════════════════════════════════════╗
- ** ║ ║
- ** ║ Copyright (c) 1993 Digital Video Arts, Ltd. ║
- ** ║ All Rights Reserved ║
- ** ║ ║
- ** ╚══════════════════════════════════════════════════════════════╝
- **
- ** Christmas card demo
- **
- ** file - xmas.c - main program;
- */
- #include <stdio.h>
- #include <fcntl.h>
- #include <conio.h>
- #include "nw.h"
- #include "nwerrno.h"
- #include "xmasdemo.h"
-
- main(int argc, char **argv)
- {
- AvH *a;
- ImH *img;
- Rect r;
- char c;
- int i;
-
- InitNewworld();
- InitDisplays();
- InitImages();
- InitAudio();
- InitAvss();
-
- while(1) {
- if(kbhit()) {
- c = getch();
- break;
- }
- PlayVideo();
- if(PlayAudio()) break;
- }
- AvClose(a);
- _nwerrno = 0;
- if(c == 's') {
- onscreen->dbm.GrPlanes = P_YVU;
- RECT(r, 0, 0, 512, 480);
- img = GrImCompress(&onscreen->dbm, &r, 0l, "NONE", -1L);
- McWait(); /* in case decompressing not done */
- GrImSave(img, &onscreen->dbm, "new");
- }
- NwEnd();
- }
-
- NwErr(char *cp)
- {
- printf("%s\n", cp);
- NwEnd();
- exit(-1);
- }
-